package westh.ilib.service.tagClouds;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author Administrator
 * 
 * @date:  Aug. 16, 2010
 * 
 */
public class TagCloudsService {
	public static String getCurrentDate()
	{
		String format="yyyy-MM-dd";
		SimpleDateFormat sdf=new SimpleDateFormat(format);
		String currentDate=sdf.format(new Date());
		return currentDate;
	}
	
	//get the day three months ago 
	public static String getThreeMonthsBefore()
	{
		String format="yyyy-MM-dd";
		SimpleDateFormat sdf=new SimpleDateFormat(format);
		Calendar calender = Calendar.getInstance();
		int month = calender.get(Calendar.MONTH) + 1;
		int year = calender.get(Calendar.YEAR);
		int date = calender.get(Calendar.DAY_OF_MONTH);
		month = 12;
		if(month-3 <= 0){
			year--;
			month = 9+month;
		}else{
			month-=3;
		}
		calender.set(year, month, date);
		String theDate=sdf.format(calender.getTime());
		return theDate;
	}
	
	public static String getCurrentTime()
	{
		String format="yyyy-MM-dd hh:mm:ss";
		SimpleDateFormat sdf=new SimpleDateFormat(format);
		String currentTime=sdf.format(new Date());
		return currentTime;
	}
	public static String getUserSetStr(){
		return "保存设置";
	}
	public static String getSaveTagStr(String tags,String score,String readStatus){
		return "保存标注信息:得分："+score+"标签："+tags+"阅读状态："+readStatus;
	}
	public static void main(String[] args) 
	{
//		String format="yyyy-MM-dd hh:mm:ss";
//		SimpleDateFormat sdf=new SimpleDateFormat(format);
//		String currentDate=sdf.format(new Date());
//		System.out.println(currentDate);
		String str="love";
		str=str+"ding";
		System.out.println(str);
	}
}
